<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    function Competor (color, weigh, type) {
      this.color = color;
      this.weigh = weigh;
      this.type = type;
      this.fun = function (funs) {
        console.log(funs);
      }
    }
    var hongmi = new Competor('天蓝色', '2kg', '因特尔');
    console.log(hongmi.color);
    console.log(hongmi.weigh);
    console.log(hongmi.type);
    hongmi.fun('看电影、听音乐、打游戏、敲代码');
  </script>
</head>

<body>

</body>

</html>